<!-- 好友信息 -->
<template>
  <div class="Info-wrapper">
    <div class="newfriend" v-show="!selectedFriend.id">
      <div class="nickname">{{selectedFriend.realName}}</div>
    </div>
    <div class="friendInfo" v-show="selectedFriend.id" style="width: 80%">
      <div class="esInfo">
        <div class="right">
          <img
            class="avatar"
            width="100"
            height="100"
            :src="'http://im.wzhwgg.com:8070/wechatwebsite/images/default.png'"
          />
        </div>
        <div class="left">
          <div class="people">
            <div class="nickname">{{selectedFriend.realName}}</div>
            <!-- <div :class="[selectedFriend.sex===1?'gender-male':'gender-female']"></div> -->
          </div>
          <div class="signature">{{selectedFriend.signature}}</div>
        </div>
      </div>
      <div class="send" style="margin: 200px auto 0;" @click="send">
        <span>发送消息</span>
      </div>
    </div>
  </div>
</template>

<script>
import router from "../../router";
import { mapGetters } from "vuex";
export default {
  computed: {
    ...mapGetters(["selectedFriend"])
  },
  methods: {
    send() {
      this.$store.dispatch("send");
      this.$store.dispatch("search", "");
    }
  }
};
</script>

<style lang="stylus" scoped>
.Info-wrapper {
  background-image : url("../../assets/images/chat-bg.png");
  background-size : 100% 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.newfriend {
  height: 60px;
  padding: 28px 0 0 30px;
  box-sizing: border-box;
  border-bottom: 1px solid #e7e7e7;

  .nickname {
    font-size: 18px;
  }
}

.friendInfo {
  padding: 0 90px;

  background-size : 100% 100%
}

.esInfo {
  padding: 180px 0 45px 0;
  box-sizing border-box;
	.left {
			text-align : center
	}
  .left {
    flex: 1;
	.people {
		margin-top: 20px;
	}
    .people {
      .nickname {
        display: inline-block;
        font-size: 35px;
        margin:20px 0 16px 0;
      }

      .gender-male, .gender-female {
        display: inline-block;
        width: 18px;
        height: 18px;
        vertical-align: top;
        margin-top: 2px;
      }

      .gender-male {
        background-image: url('man.png');
        background-size: cover;
      }

      .gender-female {
        background-image: url('woman.png');
        background-size: cover;
      }
    }

    .signature {
      font-size: 14px;
      color: rgba(153, 153, 153, 0.8);
    }
  }
  .right {
	  text-align :center
  }
  .right {
    .avatar {
      border-radius: 3px;
    }
  }
}

.send {
  position: relative;
  text-align: center;
  width: 200px;
  height: 45px;
  line-height : 45px;
  bottom: 35%;
  font-size: 20px;
  color: #fff;
  background-color: rgb(66,153,248);
  cursor: pointer;
  border-radius: 5px;

  &:hover {
    background: rgb(76,163,258);
  }
}
</style>
<style>
@media screen and (max-width: 720px) {
  .friendInfo {
    padding: 0 !important;
    width: 100% !important;
  }
  .esInfo {
    display: flex;
    flex-direction: column-reverse;
  }
  .people {
    margin-top: 50px;
  }
  .friendInfo .send {
    margin-top: 100px !important;
  }
}
</style>
